<?php
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/11/13
 * Time: 11:43 AM
 */

namespace App\Meta;

/**
 * 下单时间段描述
 * Class OrderPeriodDate
 * @package App\Meta
 */
class OrderPeriodDate
{
    /**
     * 下单日期  格式:'Y-m-d'
     * @var string
     */
    private $date;

    /**
     * 下单时间段描述
     * @var string
     */
    private $timePeriodDesc;

    /**
     * 下单时间段ID
     * @var int
     */
    private $timePeriodId = 0;

    /**
     * 半小时制服务时间段 格式 "10301200" "6300800"
     * @var int
     */
    private $halfhourPeriod = 0;

    public function __construct()
    {
        $this->date = date('Y-m-d');
        $this->timePeriodId = -1;   // 表示没有库存
    }

    /**
     * @return string
     */
    public function getDate(): string
    {
        return (string)$this->date;
    }

    /**
     * @param string $date
     */
    public function setDate(string $date): void
    {
        $this->date = $date;
    }

    /**
     * @return string
     */
    public function getTimePeriodDesc(): string
    {
        return (string)$this->timePeriodDesc;
    }

    /**
     * @param string $timePeriodDesc
     */
    public function setTimePeriodDesc(string $timePeriodDesc): void
    {
        $this->timePeriodDesc = $timePeriodDesc;
    }

    /**
     * @return int
     */
    public function getTimePeriodId(): int
    {
        return $this->timePeriodId;
    }

    /**
     * @param int $timePeriodId
     */
    public function setTimePeriodId(int $timePeriodId): void
    {
        $this->timePeriodId = $timePeriodId;
    }

    /**
     * @param int $halfhourPeriod
     */
    public function setHalfhourPeriod(int $halfhourPeriod)
    {
        $this->halfhourPeriod = $halfhourPeriod;
    }

    /**
     * @return int
     */
    public function getHalfhourPeriod()
    {
        return $this->halfhourPeriod;
    }
}
